/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.FundamentalActivities;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.gefcommon.descriptor.annotation.MethodProperty;
import edu.pku.sei.modeler.model.common.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.model.xml.XMLUtility;

import edu.pku.sei.modeler.model.uml.BasicActivities.ActivityEdge;

import edu.pku.sei.modeler.model.uml.Kernel.UMLElement;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;

/**
 * @generated
 *
 */
public class ActivityGroup extends UMLElement implements IActivityGroup {
	// attributes
	
	
	
	
	// references
	
	protected MetaTypedList containedNode;
	
	protected MetaTypedList containedEdge;
	
	protected MetaTypedList ownedElement;
	
	
	
	// getters & setters for attributes
	
	// getters for references
	
	public MetaTypedList getContainedNode() {
		if(containedNode == null) {
			containedNode = new MetaTypedList(ActivityNode.class, this, ModelPackage.ACTIVITYGROUP_CONTAINEDNODE);
		}
		return containedNode;
	}
	
	public MetaTypedList getContainedEdge() {
		if(containedEdge == null) {
			containedEdge = new MetaTypedList(ActivityEdge.class, this, ModelPackage.ACTIVITYGROUP_CONTAINEDEDGE);
		}
		return containedEdge;
	}
	
	public MetaTypedList getOwnedElement() {
		if(ownedElement == null) {
			ownedElement = new MetaTypedList(ActivityGroup.class, this, ModelPackage.ACTIVITYGROUP_OWNEDELEMENT);
		}
		return ownedElement;
	}
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		
		// references
		
		XMLUtility.xmlInstance.serializeNodesNotContain(root, ModelPackage.ACTIVITYGROUP_CONTAINEDNODE, containedNode);		
		
		XMLUtility.xmlInstance.serializeNodesNotContain(root, ModelPackage.ACTIVITYGROUP_CONTAINEDEDGE, containedEdge);		
		
		XMLUtility.xmlInstance.serializeNodes(root, ModelPackage.ACTIVITYGROUP_OWNEDELEMENT, ownedElement);
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		
		// references
		
		this.getContainedNode().addAll(XMLUtility.xmlInstance.deSerializeNodesNotContain(root, ModelPackage.ACTIVITYGROUP_CONTAINEDNODE, this));
		
		this.getContainedEdge().addAll(XMLUtility.xmlInstance.deSerializeNodesNotContain(root, ModelPackage.ACTIVITYGROUP_CONTAINEDEDGE, this));
		
		this.getOwnedElement().addAll(XMLUtility.xmlInstance.deSerializeNodes(root, ModelPackage.ACTIVITYGROUP_OWNEDELEMENT));
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		// references
		
		else if(ModelPackage.ACTIVITYGROUP_CONTAINEDNODE.equals(featureID)) {
			getContainedNode().add(value);
		}
		
		else if(ModelPackage.ACTIVITYGROUP_CONTAINEDEDGE.equals(featureID)) {
			getContainedEdge().add(value);
		}
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 